package br.com.ff.versao.dao;

import java.util.List;

import javax.persistence.EntityManager;
import javax.persistence.Query;

import br.com.ff.commons.dao.BaseDAOImpl;
import br.com.ff.versao.entidade.Versao;
import br.com.ff.versao.to.VersaoTO;

public class VersaoDAOImpl extends BaseDAOImpl implements VersaDAO {

	public VersaoDAOImpl(EntityManager entityManager) {
		super(entityManager);
	}

	@Override
	public List<Versao> findByParams(VersaoTO versaoTO) {
		
		Query query = getEntityManager().createNamedQuery("findByParam");
		query.setParameter("versao", versaoTO.getVersao());
		
		List<Versao> versoes = query.getResultList();
		
		return versoes;
	}

}
